﻿using System;
using Ayatta.Contract.Domain;

namespace Web.Core.OnlinePays
{
    /// <summary>
    /// 第三方支付平台通知
    /// </summary>
    public class Notification
    {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string No { get; set; }

        /// <summary>
        /// 支付平台订单号
        /// </summary>
        public string PayNo { get; set; }

        /// <summary>
        /// 支付订单金额(以元为单位)
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 支付室交易号/财富通交易号
        /// </summary>
        public string ExternalNo { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime PayTime { get; set; }

        /// <summary>
        /// 签名
        /// </summary>
        public string Signature { get; set; }

        /// <summary>
        /// 第三方支付平台Id
        /// </summary>
        public Platform PlatformId { get; set; }

        /// <summary>
        /// 系统处理第三方发来的通知后需回复给第三方支付平台的标识
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 通知状态
        /// </summary>
        public bool Status { get; set; }

        public Notification(Platform platformId): this(platformId, string.Empty)
        {
            PlatformId = platformId;
        }

        public Notification(Platform platformId, string token)
        {
            PlatformId = platformId;
            Token = token;
            Status = false;
        }

    }
}